package com.singzi.leetcode.N300;

import java.util.TreeMap;

public class T0300 {

}
class Solution0030 {
    public int lengthOfLIS(int[] nums) {
        int n = nums.length;
        int []dp = new int[n];
////        TreeMap<Integer, Integer> treeMap = new TreeMap<>();
//        treeMap.put(nums[0], 1);
        dp[0] = 1;
        for(int i = 1;i < n;i++){
            dp[i] = 1;
            for(int j = 0;j < i;j++){
                if(nums[i] > nums[j]  && dp[j] > dp[i]){
                    dp[i] = dp[j]+1;
                }
            }
        }

        return dp[n-1];


    }
}